<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/doc/src/qtsvg.qdoc -->
<head>
  <title>Qt 4.3: QtSvg Module</title>
  <link rel="prev" href="qtsql.html" />
  <link rel="contents" href="modules.html" />
  <link rel="next" href="qtscript.html" />
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><p>
[Previous: <a href="qtsql.html">QtSql Module</a>]
[<a href="modules.html">Qt's Modules</a>]
[Next: <a href="qtscript.html">QtScript Module</a>]
</p>
<h1 align="center">QtSvg Module<br /><small></small></h1>
<p>The QtSvg module provides classes for displaying the contents of SVG files. <a href="#details">More...</a></p>
<h2>Classes</h2>
<p><table width="100%" class="annotated" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><th><a href="qgraphicssvgitem.html">QGraphicsSvgItem</a></th><td>QGraphicsItem that can be used to render the contents of SVG files</td></tr>
<tr valign="top" class="even"><th><a href="qsvggenerator.html">QSvgGenerator</a></th><td>Paint device that is used to create SVG drawings</td></tr>
<tr valign="top" class="odd"><th><a href="qsvgrenderer.html">QSvgRenderer</a></th><td>Used to draw the contents of SVG files onto paint devices</td></tr>
<tr valign="top" class="even"><th><a href="qsvgwidget.html">QSvgWidget</a></th><td>Widget that is used to display the contents of Scalable Vector Graphics (SVG) files</td></tr>
</table></p>
<a name="details"></a>
<h2>Detailed Description</h2>
<p>Scalable Vector Graphics (SVG) is a language for describing two-dimensional graphics and graphical applications in XML. SVG 1.1 is a W3C Recommendation and forms the core of the current SVG developments in Qt. SVG 1.2 is the specification currently being developed by the <a href="http://www.w3.org/Graphics/SVG/">SVG Working Group</a>, and it is <a href="http://www.w3.org/TR/SVG12/">available in draft form</a>. The <a href="http://www.w3.org/TR/SVGMobile/">Mobile SVG Profiles</a> (SVG Basic and SVG Tiny) are aimed at resource-limited devices and are part of the 3GPP platform for third generation mobile phones. You can read more about SVG at <a href="http://www.w3.org/Graphics/SVG/About.html">About SVG</a>.</p>
<ul><li><a href="#svg-support">SVG Support</a></li>
<li><a href="#configuring-the-build-process">Configuring the Build Process</a></li>
<li><a href="#rendering-svg-files">Rendering SVG files</a></li>
<li><a href="#additional-information">Additional Information</a></li>
</ul>
<a name="svg-support"></a>
<h3>SVG Support</h3>
<p>Qt supports the <a href="http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static">static features</a> of <a href="http://www.w3.org/TR/SVGMobile12/">SVG 1.2 Tiny</a>. ECMA scripts and DOM manipulation are currently not supported.</p>
<a name="configuring-the-build-process"></a>
<h3>Configuring the Build Process</h3>
<p>Applications that use Qt's SVG classes need to be configured to be built against the QtSvg module. To include the definitions of the module's classes, use the following directive:</p>
<pre> #include &lt;QtSvg&gt;</pre>
<p>To link against the module, add this line to your <a href="qmake-manual.html#qmake">qmake</a> <tt>.pro</tt> file:</p>
<pre> QT += svg</pre>
<p>The QtSvg module is part of the <a href="commercialeditions.html#qt-desktop-edition">Qt Desktop Edition</a> and the <a href="opensourceedition.html">Qt Open Source Edition</a>.</p>
<a name="rendering-svg-files"></a>
<h3>Rendering SVG files</h3>
<p>The easiest way to render SVG files is to construct a <a href="qsvgwidget.html">QSvgWidget</a> and load an SVG file using one of the <a href="qsvgwidget.html#load">QSvgWidget::load</a>() functions.</p>
<p><a href="qsvgrenderer.html">QSvgRenderer</a> is the class responsible for rendering SVG files for <a href="qsvgwidget.html">QSvgWidget</a>, and it can be used directly to provide SVG support for custom widgets. To load an SVG file, construct a <a href="qsvgrenderer.html">QSvgRenderer</a> with a file name or the contents of a file, or call <a href="qsvgrenderer.html#load">QSvgRenderer::load</a>() on an existing renderer. If the SVG file has been loaded successfully the <a href="qsvgrenderer.html#isValid">QSvgRenderer::isValid</a>() will return true.</p>
<p>Once you have loaded the SVG file successfully, you can render it with the <a href="qsvgrenderer.html#render">QSvgRenderer::render</a>() function. Note that this scheme allows you to render SVG files on all paint devices supported by Qt, including <a href="qwidget.html">QWidget</a>, <a href="qglwidget.html">QGLWidget</a>, and <a href="qimage.html">QImage</a>. See the <a href="painting-svgviewer.html">SVG Viewer</a> example for more details.</p>
<a name="additional-information"></a>
<h3>Additional Information</h3>
<p>Some code for arc handling in this module is derived from code with the following license:</p>
<div style="padding: 0.5em; background: #e0e0e0; color: black"><p>Copyright 2002 USC/Information Sciences Institute</p>
<p>Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Information Sciences Institute not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Information Sciences Institute makes no representations about the suitability of this software for any purpose. It is provided &quot;as is&quot; without express or implied warranty.</p>
<p>INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p>
</div><p>
[Previous: <a href="qtsql.html">QtSql Module</a>]
[<a href="modules.html">Qt's Modules</a>]
[Next: <a href="qtscript.html">QtScript Module</a>]
</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
